import http from './http'
// import server from 'config/server'

export default {
  /**
   * 根据门禁大门ID分日统计每天gateID开门次数.
   * @param {String} appId app_id
   */
  getControl (params) {
    return http.post(
      `http://139.196.164.250:8088/module/parking_lot/2e0fa6b2844f2800/statistics_open_gate`, params, {
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          'Access-Token': window.localStorage.getItem('appToken')
        }
      }
    )
  },
  getListOpenGate (params) {
    return http.post(
      `http://139.196.164.250:8088/module/parking_lot/2e0fa6b2844f2800/list_open_gate`, params, {
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          'Access-Token': window.localStorage.getItem('appToken')
        }
      }
    )
  },
  // 查询门禁的状态
  getGateState (gateId) {
    return http.get(
      `http://139.196.164.250:8088/module/parking_lot/2e0fa6b2844f2800/query_gate_state/${gateId}`, {
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          'Access-Token': window.localStorage.getItem('appToken')
        }
      }
    )
  }
}
